/**
 * 使用条件表达式重写lower函数
 */

#include <stdio.h>

void lower(char s[]);

int main() {
    char s[] = "Hello, WORLD!";
    printf("%s\n", s);
    lower(s);
    printf("%s\nlength is %d\n", s, sizeof s);

    return 0;
}

void lower(char s[]) {
    int i;
    while (s[i++]) {
        s[i] = (s[i] >= 'A' && s[i] <= 'Z') ? (s[i] + 'a' - 'A') : s[i];
    }
}
